<%--
  Created by IntelliJ IDEA.
  User: 张华伟
  Date: 2021/11/30
  Time: 23:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE >
<html >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>欢迎使用停车场管理系统</title>

    <script type="text/javascript" src="js/Jquery/jquery-3.6.0.min.js"></script>
    <script type='text/javascript' src='js/Jquery/jquery.particleground.js'></script>

    <%--    //摘录代码--%>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            -ms-box-sizing: border-box;
            -o-box-sizing: border-box;
            box-sizing: border-box;
        }
        html, body {
            margin: 0;
            padding: 0;
            color: #fefeff;
            -webkit-font-smoothing: antialiased;
            font-smoothing: antialiased;
        }
        body {font-family:"Microsoft YaHei";
            background: rgb(8,5,16);
            overflow:hidden;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        h1 {
            font: 2.75em ;
            font-weight: 400;
            letter-spacing: 0.35em;
            text-shadow: 0 0 25px rgba(254,254,255,0.85);

        }
        h2 {
            font: 1.45em ;
            font-weight: 400;
            letter-spacing: 0.5em;
            text-shadow: 0 0 25px rgba(254,254,255,0.85);
            text-transform: lowercase;
        }

        [class^="letter"] {
            -webkit-transition: opacity 3s ease;
            -moz-transition: opacity 3s ease;
            transition: opacity 3s ease;
        }
        .letter-0  { transition-delay: 0.2s; }
        .letter-1  { transition-delay: 0.4s; }
        .letter-2  { transition-delay: 0.6s; }
        .letter-3  { transition-delay: 0.8s; }
        .letter-4  { transition-delay: 1.0s; }
        .letter-5  { transition-delay: 1.2s; }
        .letter-6  { transition-delay: 1.4s; }
        .letter-7  { transition-delay: 1.6s; }
        .letter-8  { transition-delay: 1.8s; }
        .letter-9  { transition-delay: 2.0s; }
        .letter-10 { transition-delay: 2.2s; }
        .letter-11 { transition-delay: 2.4s; }
        .letter-12 { transition-delay: 2.6s; }
        .letter-13 { transition-delay: 2.8s; }
        .letter-14 { transition-delay: 3.0s; }

        h1, h2 {
            visibility: hidden;
            -webkit-transform: translate3d(0, 0, 0);
            -moz-transform: translate3d(0, 0, 0);
            transform: translate3d(0, 0, 0);
        }
        h1.transition-in,
        h2.transition-in {
            visibility: visible;
        }
        h1 [class^="letter"],
        h2 [class^="letter"] {
            opacity: 0;
        }
        h1.transition-in [class^="letter"],
        h2.transition-in [class^="letter"] {
            opacity: 1;
        }

        #container {
            display: table;
            position: absolute;
            z-index: 20;
            width: 100%;
            height: 100%;
            text-align: center;
            cursor: none;
            left: 15px;
        }
        #container > div {
            display: table-cell;
            vertical-align: middle;
        }

        /*#container p {*/
        /*    position: absolute;*/
        /*    width: 100%;*/
        /*    left: 0;*/
        /*    bottom: 25px;*/
        /*    font-size: 0.8em;*/
        /*    letter-spacing: 0.1em;*/
        /*    font-weight: 300;*/
        /*    color: #76747a;*/
        /*    -webkit-font-smoothing: subpixel-antialiased;*/
        /*    font-smoothing: subpixel-antialiased;*/
        /*}*/

        /*#container p strong {*/
        /*    color: #b3abc5;*/
        /*    font-size: 5em;*/
        /*}*/
        /*#container p span {*/
        /*    font-size: 0.75em;*/
        /*    padding: 0 2px;*/
        /*}*/

        #canvas {
            position: absolute;
            z-index: 10;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            cursor: none;
        }

        #stats {
            position: absolute;
            z-index: 10;
            left: 10px;
            top: 10px;
        }

        .dg.ac {
            z-index: 100 !important;
        }

        #container div p strong a {
            color: #999;
            font-size: 0.5em;
        }
        body,td,th {

        }
        a:link {
            text-decoration: none;
        }
        a:visited {
            text-decoration: none;
        }
        a:hover {
            text-decoration: none;
        }
        a:active {
            text-decoration: none;
        }
    </style>

    <style>
        .top_div{
            position: absolute;
            background-color: transparent;
            width: 1930px;
            height: 150px;

            left: 500px;
            top: 50px;
        }

        .top_p{
            position: absolute;
            font-size: 60px;
            color: white;
        }

        .menu{
            position: absolute;
            background-color: transparent;
            height: 946.5px;
            width: 300px;

            top: -10px;
            left: -10px;
        }

        button{
            background-color: transparent;

            color: white;
            border: none;

            font-size: 30px;

            margin-left: 80px;
            margin-top: 40px;
        }

        .Information,.backMenu{
            margin-top: 210px;
        }

        .functionalSubject{
            width: 1600px;
            height: 750px;

            position: absolute;
            right: 0px;
            bottom: 0px;
        }

        input{
            display: none;
        }

        .pTips{
            color:white;
            font-size: 20px;
            margin-top: 20px;
        }
    </style>

</head>
<body ondragstart="window.event.returnValue=false" oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false">

<div id="container">

    <div >
        <div id="element" style="position: absolute;height: 100%;width:100%;top: -10px;left: 0px;animation: FadeIn 5s">
        </div>

        <h1 id="h1"></h1>
        <h2 id="h2"></h2>
    </div>


    <div class="functionalSubject" id="functionalSubject">
        <p id="p1" class="pTips"></p>
        <p id="p2"class="pTips"></p>
        <p id="p3"class="pTips"></p>
        <input id="input1">
        <p id="p4"class="pTips"></p>
        <p id="p5"class="pTips"></p>
        <input id="input2">
        <p id="p6"class="pTips"></p>
        <p id="p7" class="pTips"></p>
        <input id="input3">
        <p id="p8"class="pTips"></p>
        <p id="p9"class="pTips"></p>
        <p id="p10"class="pTips"></p>
        <p id="p11"class="pTips"></p>
        <button type="button" style="display: none" id="Preservation" onclick="Preservation()"></button>

        <button type="button" style="display: none" id="ChangePassword" onclick="ChangePassword()"></button>
        <button type="button" style="display: none" id="ChangePassword_check" onclick="ChangePassword_check()"></button>
        <button type="button" style="display: none" id="ChangePassword_sure" onclick="ChangePassword_sure()"></button>

        <button type="button" style="display: none" id="ConfirmRecharge" onclick="ConfirmRecharge()"></button>

        <button type="button" style="display: none" id="SwitchingType" onclick="SwitchingType()"></button>
        <button type="button" style="display: none" id="SwitchingType_sure" onclick="SwitchingType_sure()"></button>

        <button type="button" style="display: none" id="ConfirmRefund" onclick="ConfirmRefund()"></button>
        <button type="button" style="display: none" id="ConfirmLicensePlate" onclick="ConfirmLicensePlate()"></button>


    </div>

    <div class="menu">

        <button type="button" id="Information" class="Information" onclick="Inf()">个人信息</button>
        <button type="button" id="balance" class="balance" onclick="Bal()">余额</button>
        <button type="button" id="PlateInformation" class="PlateInformation" onclick="Plate()">车牌号码</button>

        <form action="OutLogin" method="get">
            <button type="submit" id="outLogin" class="outLogin">退出登录</button>
        </form>

        <button type="button" id="backMenu" class="backMenu" style="display: none" onclick="BackM()">返回主菜单</button>

        <button type="button" id="ViewInformation" class="ViewInformation" style="display: none" onclick="ViewInformation()">查看个人信息</button>
        <button type="button" id="ModifyInformation" class="ModifyInformation" style="display: none" onclick="ModifyInformation()">修改个人信息</button>

        <button type="button" id="ViewBalance" class="ViewBalance" style="display: none" onclick="viewBalance()">查看余额</button>
        <button type="button" id="BillDetails" class="BillDetails" style="display: none" onclick="billDetails()">账单明细</button>
        <button type="button" id="recharge" class="recharge" style="display: none" onclick="Recharge()">充值</button>
        <button type="button" id="refund" class="refund" style="display: none" onclick="Refund()">退费</button>

        <button type="button" id="ViewPlate" class="ViewPlate" style="display: none" onclick="viewPlate()">查看车牌信息</button>
        <button type="button" id="ManagePlate" class="ManagePlate" style="display: none" onclick="managePlate()">管理车牌信息</button>

        <button type="button" id="backLast1" class="backLast1" style="display: none" onclick="BackL1()">返回上一层</button>
        <button type="button" id="backLast2" class="backLast2" style="display: none" onclick="BackL2()">返回上一层</button>
        <button type="button" id="backLast3" class="backLast3" style="display: none" onclick="BackL3()">返回上一层</button>
    </div>

    <div class="top_div">
        <%
            String UserName = (String) session.getAttribute("UserName");
            out.println("<p class='top_p'>欢迎"+UserName+" </p>");
        %>
    </div>


</div>

<canvas id="canvas"></canvas>


<%--摘录代码--%>
<script>
    var Stats=function(){var e=Date.now(),t=e,i=0,n=1/0,r=0,s=0,o=1/0,a=0,l=0,h=0,c=document.createElement("div");c.id="stats",c.addEventListener("mousedown",function(e){e.preventDefault(),v(++h%2)},!1),c.style.cssText="width:80px;opacity:0.9;cursor:pointer";var u=document.createElement("div");u.id="fps",u.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002",c.appendChild(u);var d=document.createElement("div");d.id="fpsText",d.style.cssText="color:#0ff;font-size:9px;font-weight:bold;line-height:15px",d.innerHTML="FPS",u.appendChild(d);var p=document.createElement("div");for(p.id="fpsGraph",p.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff",u.appendChild(p);74>p.children.length;){var f=document.createElement("span");f.style.cssText="width:1px;height:30px;float:left;background-color:#113",p.appendChild(f)}var m=document.createElement("div");m.id="ms",m.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none",c.appendChild(m);var g=document.createElement("div");g.id="msText",g.style.cssText="color:#0f0;;font-size:9px;font-weight:bold;line-height:15px",g.innerHTML="MS",m.appendChild(g);var y=document.createElement("div");for(y.id="msGraph",y.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0",m.appendChild(y);74>y.children.length;){var f=document.createElement("span");f.style.cssText="width:1px;height:30px;float:left;background-color:#131",y.appendChild(f)}var v=function(e){switch(h=e){case 0:u.style.display="block",m.style.display="none";break;case 1:u.style.display="none",m.style.display="block"}},b=function(e,t){var i=e.appendChild(e.firstChild);i.style.height=t+"px"};return{REVISION:11,domElement:c,setMode:v,begin:function(){e=Date.now()},end:function(){var h=Date.now();return i=h-e,n=Math.min(n,i),r=Math.max(r,i),g.textContent=i+" MS ("+n+"-"+r+")",b(y,Math.min(30,30-30*(i/200))),l++,h>t+1e3&&(s=Math.round(1e3*l/(h-t)),o=Math.min(o,s),a=Math.max(a,s),d.textContent=s+" FPS ("+o+"-"+a+")",b(p,Math.min(30,30-30*(s/100))),t=h,l=0),h},update:function(){e=this.end()}}};
</script>
<script>

    ;(function(window) {

        var ctx,
            hue,
            logo,
            form,
            buffer,
            target = {},
            tendrils = [],
            settings = {};

        settings.debug = true;
        settings.friction = 0.5;
        settings.trails = 20;
        settings.size = 50;
        settings.dampening = 0.25;
        settings.tension = 0.98;

        Math.TWO_PI = Math.PI * 2;

        function Oscillator(options) {
            this.init(options || {});
        }

        Oscillator.prototype = (function() {

            var value = 0;

            return {

                init: function(options) {
                    this.phase = options.phase || 0;
                    this.offset = options.offset || 0;
                    this.frequency = options.frequency || 0.001;
                    this.amplitude = options.amplitude || 1;
                },

                update: function() {
                    this.phase += this.frequency;
                    value = this.offset + Math.sin(this.phase) * this.amplitude;
                    return value;
                },

                value: function() {
                    return value;
                }
            };

        })();

        function Tendril(options) {
            this.init(options || {});
        }

        Tendril.prototype = (function() {

            function Node() {
                this.x = 0;
                this.y = 0;
                this.vy = 0;
                this.vx = 0;
            }

            return {

                init: function(options) {

                    this.spring = options.spring + (Math.random() * 0.1) - 0.05;
                    this.friction = settings.friction + (Math.random() * 0.01) - 0.005;
                    this.nodes = [];

                    for(var i = 0, node; i < settings.size; i++) {

                        node = new Node();
                        node.x = target.x;
                        node.y = target.y;

                        this.nodes.push(node);
                    }
                },

                update: function() {

                    var spring = this.spring,
                        node = this.nodes[0];

                    node.vx += (target.x - node.x) * spring;
                    node.vy += (target.y - node.y) * spring;

                    for(var prev, i = 0, n = this.nodes.length; i < n; i++) {

                        node = this.nodes[i];

                        if(i > 0) {

                            prev = this.nodes[i - 1];

                            node.vx += (prev.x - node.x) * spring;
                            node.vy += (prev.y - node.y) * spring;
                            node.vx += prev.vx * settings.dampening;
                            node.vy += prev.vy * settings.dampening;
                        }

                        node.vx *= this.friction;
                        node.vy *= this.friction;
                        node.x += node.vx;
                        node.y += node.vy;

                        spring *= settings.tension;
                    }
                },

                draw: function() {

                    var x = this.nodes[0].x,
                        y = this.nodes[0].y,
                        a, b;

                    ctx.beginPath();
                    ctx.moveTo(x, y);

                    for(var i = 1, n = this.nodes.length - 2; i < n; i++) {

                        a = this.nodes[i];
                        b = this.nodes[i + 1];
                        x = (a.x + b.x) * 0.5;
                        y = (a.y + b.y) * 0.5;

                        ctx.quadraticCurveTo(a.x, a.y, x, y);
                    }

                    a = this.nodes[i];
                    b = this.nodes[i + 1];

                    ctx.quadraticCurveTo(a.x, a.y, b.x, b.y);
                    ctx.stroke();
                    ctx.closePath();
                }
            };

        })();

        function init(event) {

            document.removeEventListener('mousemove', init);
            document.removeEventListener('touchstart', init);

            document.addEventListener('mousemove', mousemove);
            document.addEventListener('touchmove', mousemove);
            document.addEventListener('touchstart', touchstart);

            mousemove(event);
            reset();
            loop();
        }

        function reset() {

            tendrils = [];

            for(var i = 0; i < settings.trails; i++) {

                tendrils.push(new Tendril({
                    spring: 0.45 + 0.025 * (i / settings.trails)
                }));
            }
        }

        function loop() {

            if(!ctx.running) return;

            ctx.globalCompositeOperation = 'source-over';
            ctx.fillStyle = 'rgba(8,5,16,0.4)';
            ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
            ctx.globalCompositeOperation = 'lighter';
            ctx.strokeStyle = 'hsla(' + Math.round(hue.update()) + ',90%,50%,0.25)';
            ctx.lineWidth = 1;

            if(ctx.frame % 60 == 0) {
                console.log(hue.update(), Math.round(hue.update()), hue.phase, hue.offset, hue.frequency, hue.amplitude);
            }

            for(var i = 0, tendril; i < settings.trails; i++) {
                tendril = tendrils[i];
                tendril.update();
                tendril.draw();
            }

            ctx.frame++;
            ctx.stats.update();
            requestAnimFrame(loop);
        }

        function resize() {
            ctx.canvas.width = window.innerWidth;
            ctx.canvas.height = window.innerHeight;
        }

        function start() {
            if(!ctx.running) {
                ctx.running = true;
                loop();
            }
        }

        function stop() {
            ctx.running = false;
        }

        function mousemove(event) {
            if(event.touches) {
                target.x = event.touches[0].pageX;
                target.y = event.touches[0].pageY;
            } else {
                target.x = event.clientX
                target.y = event.clientY;
            }
            event.preventDefault();
        }

        function touchstart(event) {
            if(event.touches.length == 1) {
                target.x = event.touches[0].pageX;
                target.y = event.touches[0].pageY;
            }
        }

        function keyup(event) {

            switch(event.keyCode) {
                case 32:
                    save();
                    break;
                default:
            }
        }

        function letters(id) {

            var el = document.getElementById(id),
                letters = el.innerHTML.replace('&amp;', '&').split(''),
                heading = '';

            for(var i = 0, n = letters.length, letter; i < n; i++) {
                letter = letters[i].replace('&', '&amp');
                heading += letter.trim() ? '<span class="letter-' + i + '">' + letter + '</span>' : '&nbsp;';
            }

            el.innerHTML = heading;
            setTimeout(function() {
                el.className = 'transition-in';
            }, (Math.random() * 500) + 500);
        }

        function save() {

            if(!buffer) {

                buffer = document.createElement('canvas');
                buffer.width = screen.availWidth;
                buffer.height = screen.availHeight;
                buffer.ctx = buffer.getContext('2d');

                form = document.createElement('form');
                form.method = 'post';
                form.input = document.createElement('input');
                form.input.type = 'hidden';
                form.input.name = 'data';
                form.appendChild(form.input);

                document.body.appendChild(form);
            }

            buffer.ctx.fillStyle = 'rgba(8,5,16)';
            buffer.ctx.fillRect(0, 0, buffer.width, buffer.height);

            buffer.ctx.drawImage(canvas,
                Math.round(buffer.width / 2 - canvas.width / 2),
                Math.round(buffer.height / 2 - canvas.height / 2)
            );

            buffer.ctx.drawImage(logo,
                Math.round(buffer.width / 2 - logo.width / 4),
                Math.round(buffer.height / 2 - logo.height / 4),
                logo.width / 2,
                logo.height / 2
            );

            window.open(buffer.toDataURL(), 'wallpaper', 'top=0,left=0,width=' + buffer.width + ',height=' + buffer.height);
        }

        window.requestAnimFrame = (function() {
            return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(fn) { window.setTimeout(fn, 1000 / 60) };
        })();

        window.onload = function() {

            ctx = document.getElementById('canvas').getContext('2d');
            ctx.stats = new Stats();
            ctx.running = true;
            ctx.frame = 1;

            logo = new Image();
            logo.src = 'http://labs.nikrowell.com/lightsandmotion/ultraviolet/images/logo.png';

            hue = new Oscillator({
                phase: Math.random() * Math.TWO_PI,
                amplitude: 85,
                frequency: 0.0015,
                offset: 285
            });

            letters('h1');
            letters('h2');

            document.addEventListener('mousemove', init);
            document.addEventListener('touchstart', init);
            document.body.addEventListener('orientationchange', resize);
            window.addEventListener('resize', resize);
            window.addEventListener('keyup', keyup);
            window.addEventListener('focus', start);
            window.addEventListener('blur', stop);

            resize();

            if(window.DEBUG) {

                var gui = new dat.GUI();

                // gui.add(settings, 'debug');
                settings.gui.add(settings, 'trails', 1, 30).onChange(reset);
                settings.gui.add(settings, 'size', 25, 75).onFinishChange(reset);
                settings.gui.add(settings, 'friction', 0.45, 0.55).onFinishChange(reset);
                settings.gui.add(settings, 'dampening', 0.01, 0.4).onFinishChange(reset);
                settings.gui.add(settings, 'tension', 0.95, 0.999).onFinishChange(reset);

                document.body.appendChild(ctx.stats.domElement);
            }
        };

    })(window);
</script>

<script>
    $('#element').particleground({
        dotColor: '#1c6ec9',
        lineColor: '#1c6ec9'
    });
</script>

<script >
    //一级菜单按钮

    var inf=document.getElementById("Information");
    var bal=document.getElementById("balance");
    var plate=document.getElementById("PlateInformation");
    var outL=document.getElementById("outLogin");
    //二级菜单按钮
    var backM=document.getElementById("backMenu");

    var ViewInf=document.getElementById("ViewInformation");
    var ModInf=document.getElementById("ModifyInformation");

    var ViewBalance=document.getElementById("ViewBalance");
    var BilDet=document.getElementById("BillDetails");
    var rech=document.getElementById("recharge");
    var refund=document.getElementById("refund");

    var ViewPla=document.getElementById("ViewPlate");
    var MagPla=document.getElementById("ManagePlate");
    //三级菜单按钮
    var backL1=document.getElementById("backLast1");
    var backL2=document.getElementById("backLast2");
    var backL3=document.getElementById("backLast3");

    //按钮变化
    function ToNextMenu(){
        inf.style.display="none";
        bal.style.display="none";
        plate.style.display="none";
        outL.style.display="none";

        backM.style.display="block";
    }

    function Inf(){
        ToNextMenu();

        ViewInf.style.display="block";
        ModInf.style.display="block";
    }

    function Bal(){
        ToNextMenu();

        ViewBalance.style.display="block";
        BilDet.style.display="block";
        rech.style.display="block";
        refund.style.display="block";
    }

    function Plate(){
        ToNextMenu();

        ViewPla.style.display="block";
        MagPla.style.display="block";
    }

    function BackM(){
        init();

        ViewInf.style.display="none";
        ModInf.style.display="none";
        ViewBalance.style.display="none";
        BilDet.style.display="none";
        rech.style.display="none";
        refund.style.display="none";
        ViewPla.style.display="none";
        MagPla.style.display="none";
        backM.style.display="none";

        inf.style.display="block";
        bal.style.display="block";
        plate.style.display="block";
        outL.style.display="block";

        backL1.style.display="none";
        backL2.style.display="none";
        backL3.style.display="none";
    }

    function BackL1(){
        Inf();
        init();
        backL1.style.display="none";
    }


    function BackL2(){
        Bal();
        init();
        backL2.style.display="none";
    }

    function BackL3(){
        Plate();
        init();
        backL3.style.display="none";
    }

    //功能实现
    var userName = '<%=(String) session.getAttribute("UserName") %>';
    var password = '<%=(String) session.getAttribute("Password") %>';
    var phoneNum = '<%=(String) session.getAttribute("PhoneNumber") %>';
    var email = '<%=(String) session.getAttribute("Email") %>';
    var registrationDate = '<%=(String) session.getAttribute("RegistrationTime") %>';
    var lastRechargeTime = '<%=(String) session.getAttribute("LastRechargeTime") %>';

    var Type = '<%=(String) session.getAttribute("Type") %>';
    var balance = '<%=(String) session.getAttribute("Balance") %>';
    var Balance_date='<%=(String) session.getAttribute("Balance_date") %>';
    var Balance_Frequency='<%=(String) session.getAttribute("Balance_Frequency") %>'

    var BillingRecords1Num='<%=session.getAttribute("aa0") %>'
    var BillingRecords2Num='<%=session.getAttribute("aa1") %>'
    var BillingRecords3Num='<%=session.getAttribute("aa2") %>'
    var BillingRecords4Num='<%=session.getAttribute("aa3") %>'
    var BillingRecords5Num='<%=session.getAttribute("aa4") %>'

    var carNumber1='<%=session.getAttribute("CarNumber1") %>';
    var carNumber2='<%=session.getAttribute("CarNumber2") %>';
    var carNumber3='<%=session.getAttribute("CarNumber3") %>';

    // console.log(carNumber1);

    function init(){
        document.getElementById("p1").innerText="";
        document.getElementById("p2").innerText="";
        document.getElementById("p3").innerText="";
        document.getElementById("p4").innerText="";
        document.getElementById("p5").innerText="";
        document.getElementById("p6").innerText="";
        document.getElementById("p7").innerText="";
        document.getElementById("p8").innerText="";
        document.getElementById("p9").innerText="";
        document.getElementById("p10").innerText="";
        document.getElementById("p11").innerText="";

        document.getElementById("input1").value="";
        document.getElementById("input2").value="";
        document.getElementById("input1").style.display="none";
        document.getElementById("input2").style.display="none";
        document.getElementById("input3").value="";
        document.getElementById("input3").style.display="none"

        document.getElementById("Preservation").style.display="none";
        document.getElementById("ChangePassword").style.display="none";
        document.getElementById("ConfirmRecharge").style.display="none";
        document.getElementById("SwitchingType").style.display="none";
        document.getElementById("ConfirmRefund").style.display="none";
        document.getElementById("ConfirmLicensePlate").style.display="none";

        document.getElementById("ChangePassword_check").style.display="none";
        document.getElementById("ChangePassword_sure").style.display="none";
        document.getElementById("SwitchingType_sure").style.display="none";
    }

    function ViewInformation(){
        ToNextMenu();
        ViewInf.style.display="none";
        ModInf.style.display="none";
        backL1.style.display="block";

        //
        document.getElementById("p1").innerText="用户名";
        document.getElementById("p2").innerText=userName;
        document.getElementById("p3").innerText="电话号码";
        document.getElementById("p4").innerText=phoneNum;
        document.getElementById("p5").innerText="电子邮箱";
        document.getElementById("p6").innerText=email;
        document.getElementById("p7").innerText="最后登录日期";
        document.getElementById("p8").innerText=registrationDate;
        document.getElementById("p9").innerText="最后充值日期";
        document.getElementById("p10").innerText=lastRechargeTime;
    }

    function ModifyInformation(){
        ToNextMenu();
        ViewInf.style.display="none";
        ModInf.style.display="none";
        backL1.style.display="block";

        //
        document.getElementById("p1").innerText="用户名";
        document.getElementById("p2").innerText=userName;
        document.getElementById("p3").innerText="电话号码";
        document.getElementById("input1").style.display="block";
        document.getElementById("input1").value=phoneNum;
        document.getElementById("p5").innerText="电子邮箱";
        document.getElementById("input2").style.display="block";
        document.getElementById("input2").value=email;
        document.getElementById("p7").innerText="最后登录日期";
        document.getElementById("p8").innerText=registrationDate;
        document.getElementById("p9").innerText="最后充值日期";
        document.getElementById("p10").innerText=lastRechargeTime;
        document.getElementById("Preservation").style.display="block";
        document.getElementById("Preservation").innerText="保存并提交";
        document.getElementById("ChangePassword").style.display="block";
        document.getElementById("ChangePassword").innerText="修改密码";
    }

    function viewBalance(){
        ToNextMenu();
        ViewBalance.style.display="none";
        BilDet.style.display="none";
        rech.style.display="none";
        refund.style.display="none";
        backL2.style.display="block";

        //
        document.getElementById("p1").innerText="尊敬的"+userName+"用户";
        document.getElementById("p2").innerText="目前您的账户余额为：";
        document.getElementById("p3").innerText=balance+"元";

        if(Type=="mouth"){
            document.getElementById("p4").innerText="您是尊贵的月卡用户";
            document.getElementById("p5").innerText="您的剩余可用天数为";
            document.getElementById("p6").innerText=Balance_date+"天";
        }else if(Type=="frequency"){
            document.getElementById("p4").innerText="您是尊贵的次卡用户";
            document.getElementById("p5").innerText="您的剩余可用次数为";
            document.getElementById("p6").innerText=Balance_Frequency+"次";
        }
    }

    function billDetails(){
        ToNextMenu();
        ViewBalance.style.display="none";
        BilDet.style.display="none";
        rech.style.display="none";
        refund.style.display="none";
        backL2.style.display="block";

        //
        document.getElementById("p1").innerText="尊敬的用户，您最近五次的充值或消费记录为：";

        if (BillingRecords1Num<0){
            document.getElementById("p3").innerText="消费"+BillingRecords1Num*-1+"元";
        }else{
            document.getElementById("p3").innerText="充值"+BillingRecords1Num+"元";
        }

        if (BillingRecords2Num<0){
            document.getElementById("p5").innerText="消费"+BillingRecords2Num*-1+"元";
        }else{
            document.getElementById("p5").innerText="充值"+BillingRecords2Num+"元";
        }

        if (BillingRecords3Num<0){
            document.getElementById("p7").innerText="消费"+BillingRecords3Num*-1+"元";
        }else{
            document.getElementById("p7").innerText="充值"+BillingRecords3Num+"元";
        }

        if (BillingRecords4Num<0){
            document.getElementById("p9").innerText="消费"+BillingRecords4Num*-1+"元";
        }else{
            document.getElementById("p9").innerText="充值"+BillingRecords4Num+"元";
        }

        if (BillingRecords5Num<0){
            document.getElementById("p11").innerText="消费"+BillingRecords5Num*-1+"元";
        }else{
            document.getElementById("p11").innerText="充值"+BillingRecords5Num+"元";
        }
    }

    function Recharge(){
        ToNextMenu();
        ViewBalance.style.display="none";
        BilDet.style.display="none";
        rech.style.display="none";
        refund.style.display="none";
        backL2.style.display="block";

        //
        document.getElementById("p1").innerText="您目前的余额为：";
        document.getElementById("p2").innerText=balance;
        document.getElementById("p3").innerText="请输入将充值的金额:"
        document.getElementById("input2").style.display="block";
        document.getElementById("ConfirmRecharge").innerText="确认充值";
        document.getElementById("ConfirmRecharge").style.display="block";
        document.getElementById("SwitchingType").innerText="切换充值项目";
        document.getElementById("SwitchingType").style.display="block";
    }

    function Refund(){
        ToNextMenu();
        ViewBalance.style.display="none";
        BilDet.style.display="none";
        rech.style.display="none";
        refund.style.display="none";
        backL2.style.display="block";

        //
        document.getElementById("p1").innerText="您目前的余额为：";
        document.getElementById("p2").innerText=balance;
        document.getElementById("p3").innerText="请输入将退费的金额:"
        document.getElementById("input2").style.display="block";
        document.getElementById("ConfirmRefund").innerText="确认退费";
        document.getElementById("ConfirmRefund").style.display="block";
    }

    function viewPlate(){
        ToNextMenu();
        ViewPla.style.display="none";
        MagPla.style.display="none";
        backL3.style.display="block";

        //
        document.getElementById("p1").innerText="尊敬的用户"+userName;
        document.getElementById("p2").innerText="您所绑定的车牌号码为：";

        // console.log(carNumber1);
        // console.log(carNumber2);
        // console.log(carNumber3);

        if(carNumber1!=""){
            document.getElementById("p3").innerText=carNumber1;
        }
        if(carNumber2!=""){
            document.getElementById("p4").innerText=carNumber2;
        }
        if(carNumber3!=""){
            document.getElementById("p5").innerText=carNumber3;
        }
        if(carNumber1=="null"&&carNumber2=="null"&&carNumber3=="null"){
            document.getElementById("p2").innerText="您暂时未在账户上绑定任何车牌!";
            document.getElementById("p3").innerText="";
            document.getElementById("p4").innerText="";
            document.getElementById("p5").innerText="";
        }
    }

    function managePlate(){
        ToNextMenu();
        ViewPla.style.display="none";
        MagPla.style.display="none";
        backL3.style.display="block";

        //
        document.getElementById("p1").innerText="尊敬的用户"+userName;
        document.getElementById("p2").innerText="一个账户最多能绑定三个车牌号码";
        document.getElementById("input1").style.display="block";
        document.getElementById("input1").value=carNumber1;
        document.getElementById("input2").style.display="block";
        document.getElementById("input2").value=carNumber2;
        document.getElementById("input3").style.display="block";
        document.getElementById("input3").value=carNumber3;
        document.getElementById("ConfirmLicensePlate").innerText="确认修改";
        document.getElementById("ConfirmLicensePlate").style.display="block";
    }

    var UserData;
    function Preservation(){
        var request=new XMLHttpRequest();
        request.open("POST","ChangeUserMessage");
        request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

        UserData="PhoneNumber="+document.getElementById("input1").value+"&Email="+document.getElementById("input2").value;
        request.send(UserData);

        phoneNum=document.getElementById("input1").value;
        email=document.getElementById("input2").value;

        init();
        document.getElementById("p1").innerText="个人信息修改成功！";
    }

    function ChangePassword(){
        init();
        document.getElementById("p1").innerText="请输入当前密码";
        document.getElementById("input1").style.display="block"
        document.getElementById("ChangePassword_check").innerText="确认密码";
        document.getElementById("ChangePassword_check").style.display="block";
    }

    function ChangePassword_check(){
        var pwd_old = document.getElementById("input1").value;

        if(pwd_old==password){
            init();
            document.getElementById("p1").innerText="请输入新密码";
            document.getElementById("input1").style.display="block";
            document.getElementById("p4").innerText="请再次确认新密码";
            document.getElementById("input2").style.display="block";
            document.getElementById("ChangePassword_sure").style.display="block";
            document.getElementById("ChangePassword_sure").innerText="确认修改";
        }else{
            document.getElementById("p4").innerText="用户输入密码与原本密码不一致，请重新检查！";
        }
    }

    function ChangePassword_sure(){
        var pwd1 =document.getElementById("input1").value;
        var pwd2 =document.getElementById("input2").value;

        if(pwd1==pwd2){
            //
            var request=new XMLHttpRequest();
            request.open("POST","ChangePassword");
            request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

            var pwd="Password="+pwd1;
            request.send(pwd);

            init();
            document.getElementById("p1").innerText="修改成功！";

        }else {
            document.getElementById("p6").innerText="您两次输入的密码不一致，请重新检查！";
        }
    }

    var money;
    function ConfirmRecharge(){
        //
        var request=new XMLHttpRequest();
        request.open("POST","ConfirmRecharge");
        request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

        money = "money="+document.getElementById("input2").value;

        console.log(money);
        request.send(money);

        init();
        document.getElementById("p1").innerText="充值成功！";

    }

    function SwitchingType(){

        init();

        if(Type=="mouth"){
            document.getElementById("p1").innerText="您是尊贵的月卡用户";
            document.getElementById("p2").innerText="您的剩余可用天数为"+Balance_date+"天";
            document.getElementById("p3").innerText="请输入您要续费的天数：";
            document.getElementById("input1").style.display="block";

        }else if(Type=="frequency"){
            document.getElementById("p4").innerText="您是尊贵的次卡用户";
            document.getElementById("p5").innerText="您的剩余可用次数为"+Balance_Frequency+"次";
            document.getElementById("p3").innerText="请输入您要续费的次数：";
            document.getElementById("input1").style.display="block";
        }
        document.getElementById("SwitchingType_sure").style.display="block";
        document.getElementById("SwitchingType_sure").innerText="确认充值";
    }

    var count;
    function SwitchingType_sure(){
        var request=new XMLHttpRequest();
        request.open("POST","switchType");
        request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

        if(Type=="mouth"){
            count = "Type="+"0&"+"count="+document.getElementById("input1").value;
        }else {
            count = "Type="+"1&"+"count="+document.getElementById("input1").value;
        }

        console.log(count);
        request.send(count);


        init();
        document.getElementById("p1").innerText="充值成功";
    }

    var refund;
    function ConfirmRefund(){
        var request=new XMLHttpRequest();
        request.open("POST","RefundCharge");
        request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

        refund="money="+document.getElementById("input2").value;
        console.log(refund);

        request.send(refund);


        init();
        document.getElementById("p1").innerText="退费成功";
    }

    var carID;
    function ConfirmLicensePlate(){
        var request=new XMLHttpRequest();
        request.open("POST","ManageCarId");
        request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

        carID="CarNumber1="+document.getElementById("input1").value+"&"+"CarNumber2="+document.getElementById("input2").value+"&"+"CarNumber3="+document.getElementById("input3").value;
console.log(carID);
        request.send(carID);

        init();
        document.getElementById("p1").innerText="修改成功";
    }
</script>

</body>
</html>
